
#ifndef __ENGINEINTERFACE_H_
#define __ENGINEINTERFACE_H_

#include <windows.h>

#define IMMKPBOUNDARY_GRID 1
#define IMMKPBOUNDARY_FILL 2

class engineInterface
{
protected:
	HWND m_hWnd;
	DWORD m_dwWidth;
	DWORD m_dwHeight;
	DWORD m_dwDepth;
	BOOL m_bWindowed;

public:
	engineInterface(){};
	virtual ~engineInterface(){};

	virtual HRESULT Resize3DEnvironment(int, int) = 0;

    // Internal error handling function
    virtual HRESULT DisplayErrorMsg( HRESULT hr, DWORD dwType ) =0;

	virtual void SetRotaion(float, float, float) = 0;

	virtual void ZoomIn(int) = 0;

	virtual void freeTriangles() = 0;
	virtual HRESULT setTriangles(float*, int, int*, int, 
								float*, int, int*, int, 
								float*, int, int*, int) = 0;
	virtual HRESULT setDataInfo(
		float xmin, float xmax, float ymin, float ymax, float zmin, float zmax, char* textInfo) = 0;
	virtual HRESULT setBounds(float, float, float, float, float, float) = 0;
	virtual HRESULT setBoundary(float*, int, int*, int) =0;
	virtual HRESULT RenderTriangles() = 0;
	virtual void setDrawState(BOOL bDrawGrid, BOOL bDrawFill, BOOL bDrawAxes, int iDrawBoundary, int bDrawSurf[3]) = 0;
	virtual void drawText(int, int, char*) = 0;
	//method to create and initialize our hardware
    virtual HRESULT createDevice(HWND, DWORD, DWORD, DWORD, BOOL) = 0;

    //method to destroy it
    virtual void destroyDevice() = 0;

    //method to begin rendering primitives
    virtual HRESULT beginRenderingScene() = 0;

    //method to end rendering primitives
    virtual void endRenderingScene() = 0;

    //method to change the screen clearing color
    virtual void setClearColor(FLOAT, FLOAT, FLOAT, FLOAT) = 0;
	virtual void toggleLighting() = 0;
};

extern "C"
{
	HRESULT createEngineInterface(engineInterface **pInterface);
	typedef HRESULT (*CREATEENGINEINTERFACE)(engineInterface **pInterface);

	HRESULT destroyEngineInterface(engineInterface **pInterface);
	typedef HRESULT (*DESTROYENGINEINTERFACE)(engineInterface **pInterface);
}

#endif